package dm;

/**
 * <p>Title: Domain Model Generator</p>
 *
 * <p>Description: Automatic generation of a domain model</p>
 *
 * <p>Copyright: Copyright (c) 2011</p>
 *
 * <p>Company: UTA</p>
 *
 * @author David Kung
 * @version 1.0
 */
import java.util.*;
import util.*;

public class TionNouns
    extends DMComp {
  public TionNouns() {
    super();
  }

  public TionNouns(String fileName) {
    super(fileName);
  }
  public void collectTionWords(Segment p) {
    ArrayList al=new ArrayList();
    String content = new String(p.getContent());
    String content1=dePunctuate(content).toLowerCase();
    StringTokenizer str=new StringTokenizer(content1);
    while (str.hasMoreTokens()) {
      String token=str.nextToken().toLowerCase();
      if ((token.endsWith("tion") || token.endsWith("tions")) &&
         !al.contains(token))
        al.add(token);
    }
    String[] tionWords=new String[al.size()];
    al.toArray(tionWords);
    PersistenceMgr.save(tionWords, "dict/tionwords.txt");
  }
  public String markIt(String s) {
    return "<N "+s+">";
  }
}
